<!DOCTYPE html>
<!--suppress ALL-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta charset="UTF-8">
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link th:href="@{/bootstrap/bootstrap.min.css}" rel="stylesheet">
    <link rel="stylesheet" type="text/css" th:href="@{/css/jqTable.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/page/page.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/bootstrap/bootstrap.min.css}">
    <script th:src="@{/js/jquery-2.1.4.min.js}"></script>
    <script th:src="@{/js/laydate.js}"></script>
    <script type="text/javascript" th:src="@{/bootstrap/bootstrap-select.js}"></script>
    <link rel="stylesheet" type="text/css" th:href="@{/bootstrap/bootstrap-select.css}">
    <script type="text/javascript" th:src="@{/bootstrap/bootstrap.min.js}"></script>


    <script>
        document.addEventListener("DOMContentLoaded", function () {
            $('.selectpicker').selectpicker({
                'selectedText': 'cat'
            });
        });
    </script>
    <style type="text/css">
        .pageTest {
            width: 70%;
            height: 50px;
            margin-top: 0%;
        }

        .activP {
            background-color: #367fa9 !important;
            color: #fff !important;
        }
    </style>
    <style>
        .p20 {
            padding: 20px;
        }

        .mt20 {
            margin-top: 20px;
        }

        .mr10 {
            margin-right: 10px;
        }

        .hide {
            display: none;
        }

    </style>
    <script>
        $(document).ready(function () {
            $(".b").fadeIn(100)
        });
    </script>
</head>
<body class="b" style="display: none;background-color: #f9f9f9;opacity: 0.85;padding-left:5%;padding-right: 5%;-webkit-background-size: 100%;background-repeat: no-repeat;background-size: cover;background-attachment: fixed">
<div style="margin-bottom: 1%;margin-top: 3%" class="col-sm-12">
    <div class="btn-group col-sm-2">
        <a type="button" th:style="${isDetail} eq '0'?'background-color:grey':''" class="btn btn-primary"
           th:href="'/directionary/admin/logdispprjGet/1/'+${startTime}+'/'+${endTime}+'/全文访问日志/1/1/1'"
        >详细信息</a>
        <a type="button" th:style="${isDetail} eq '1'?'background-color:grey':''" class="btn btn-primary"
           th:href="'/directionary/admin/logdispprjGet/0/'+${startTime}+'/'+${endTime}+'/全文访问日志/1/1/1'"
        >统计信息</a>
    </div>
    <div class="col-sm-1" style="margin-top: 5px">
        <b><span style="font-size: large">开始时间:</span></b>
    </div>
    <div class="col-sm-1" style="float: left;margin-left: -3%">
        <input autocomplete="off" id="time1"
               name="startTime"
               style="width: 100%;background: #fefefe;border: 1px solid #bbb;font-size: 14px;color: #333;padding: 7px;border-radius: 3px;"
               type="text" th:value="${startTime}">
    </div>
    <div class="col-sm-1" style="margin-top: 5px">
        <b><span style="font-size: large">结束时间:</span></b>
    </div>
    <div class="col-sm-1" style="margin-left: -3%">
        <input autocomplete="off" id="time2"
               name="startTime"
               style="width: 100%;background: #fefefe;border: 1px solid #bbb;font-size: 14px;color: #333;padding: 7px;border-radius: 3px;"
               type="text" th:value="${endTime}">
    </div>
    <!--<div class="col-sm-2" th:if="${isDetail} eq '0'">-->
        <!--<select name="actionName" id="action1" class="selectpicker bla bla bli"-->
                <!--data-live-search="true">-->
            <!--<div th:each="action:${actions}">-->
                <!--<option th:text="${action}" th:selected="${action} eq ${actionName}"></option>-->
            <!--</div>-->
        <!--</select>-->
    <!--</div>-->
    <div th:if="${isDetail} eq '0'" class="col-sm-1">
        <select id="dateType" class="selectpicker bla bla bli" data-live-search="true">
            <option value="1" th:selected="${dateType} eq '1'">日报表</option>
            <option value="2" th:selected="${dateType} eq '2'">月报表</option>
            <option value="3" th:selected="${dateType} eq '3'">年报表</option>
        </select>
    </div>
    <div th:if="${isDetail} eq '0'" class="col-sm-1">
        <select id="category" class="selectpicker bla bla bli" data-live-search="true">
            <option value="1" th:selected="${category} eq '1'">用户访问</option>
            <option value="2" th:selected="${category} eq '2'">IP访问</option>
            <option value="3" th:selected="${category} eq '3'">全文访问</option>
        </select>
    </div>
    <div class="col-sm-1">
        <input type="button" class="btn btn-default" value="查询"
               th:onclick="|javascript:search('${isDetail}')|"
        />
    </div>
    <div class="col-sm-1" th:if="${isDetail} eq '1'">
        <a type="button" class="btn btn-primary" onclick="del()">清空当前日志</a>
    </div>
    <div class="col-sm-1">
        <a type="button" class="btn btn-primary" th:text="'一共'+${count}+'条数据'"></a>
    </div>
</div>
<div class="g-selectAll--main">
    <div class="c-table c-table--border">
        <table id="tab02" cellspacing="0" cellpadding="0" border="1" role="c-table">
            <span th:if="${isDetail} eq '1'">
                <thead>
            <tr>
                <th>
                    <b>
                        序号
                    </b>
                </th>
                <th>
                    <b>
                        访问者
                    </b>
                </th>
                <th>
                    <b>
                        标题
                    </b>
                </th>
                <th>
                    <b>
                        操作时间
                    </b>
                </th>
            </tr>
            </thead>
            <tbody th:if="${isDetail} eq '1'">
            <tr th:each="log:${logs}">
                <td th:text="${logStat.index+prePage*10+1}"></td>
                <td th:text="${log.userip}"></td>
                <td th:text="${log.prjectname}"></td>
                <td th:text="${log.logtime}"></td>
            </tr>
            </tbody>
            </span>
            <span th:unless="${isDetail} eq '1'">
                <thead>
            <tr>
                <th>
                    <b>
                        序号
                    </b>
                </th>
                <th th:if="${category} eq '1'">
                    <b>
                        访问人员
                    </b>
                </th>
                <th th:if="${category} eq '2'">
                    <b>
                        用户IP
                    </b>
                </th>
                <th th:if="${category} eq '3'">
                    <b>
                        浏览对象
                    </b>
                </th>
                <th>
                    <b>
                        浏览次数
                    </b>
                </th>
                <th>
                    <b>
                        浏览时间
                    </b>
                </th>
            </tr>
            </thead>
                <tbody th:if="${isDetail} eq '0'">
                    <tr th:each="log:${logsVO}">
                        <td th:text="${logStat.index+prePage*10+1}"></td>
                        <td th:text="${log.userName}"></td>
                        <td th:text="${log.actionCounts}"></td>
                        <td th:if="${dateType} eq '1'" th:text="${log.date}+'号'"></td>
                        <td th:if="${dateType} eq '2'" th:text="${log.date}+'月'"></td>
                        <td th:if="${dateType} eq '3'" th:text="${log.date}+'年'"></td>
                    </tr>
                </tbody>
            </span>
        </table>
    </div>
</div>
<div th:unless="${count} eq '0'">
    <ul class="pager">
        <b th:if="${page} gt '1'">
            <li>
                <a th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/1'+'/'+${category}"><<</a>
            </li>
        </b>
        <b th:unless="${page} gt '1'">
            <li>
                <a th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/1'+'/'+${category}"><<</a>
            </li>
        </b>
        <b th:if="${pageCount}>'5'">
            <li th:if="${page} gt '1'"><a
                    th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${prePage}+'/'+${category}"
                    th:text="${prePage}"></a></li>
            <b th:if="${diffValue}>='5'">
                <li><a style="background-color: gainsboro"
                       th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${page}+'/'+${category}"
                       th:text="${page}"></a></li>
                <li>
                    <a th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${page+1}+'/'+${category}"
                       th:text="${page+1}"></a></li>
                <li>
                    <a th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${page+2}+'/'+${category}"
                       th:text="${page+2}"></a></li>
                <li>
                    <a th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${page+3}+'/'+${category}"
                       th:text="${page+3}"></a></li>
                <li>
                    <a th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${page+4}+'/'+${category}"
                       th:text="${page+4}"></a></li>
                <li>
                    <a th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${page+5}+'/'+${category}">>></a>
                </li>
            </b>
            <b th:unless="${diffValue}>='5'">
                <b th:each="p:${#numbers.sequence(0,diffValue)}">
                    <b th:if="${page+p} le ${pageCount}">
                        <li th:if="${p} eq '0'"><a style="background-color: gainsboro"
                                                   th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${page+p}+'/'+${category}"
                                                   th:text="${page+p}"></a>
                        </li>
                        <li th:unless="${p} eq '0'"><a
                                th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${page+p}+'/'+${category}"
                                th:text="${page+p}"></a>
                        </li>
                    </b>
                </b>
                <li>
                    <a th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${page+diffValue}+'/'+${category}">>></a>
                </li>
            </b>
        </b>
        <b th:unless="${pageCount}>'5'">
            <li th:if="${page} gt '1'"><a
                    th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${prePage}+'/'+${category}"
                    th:text="${prePage}"></a></li>
            <b th:each="p:${#numbers.sequence(0,pageCount)}">
                <b th:if="${page+p} le ${pageCount}">
                    <li th:if="${p} eq '0'"><a style="background-color: gainsboro"
                                               th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${page+p}+'/'+${category}"
                                               th:text="${page+p}"></a>
                    </li>
                    <li th:unless="${p} eq '0'"><a
                            th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${page+p}+'/'+${category}"
                            th:text="${page+p}"></a>
                    </li>
                </b>
            </b>
            <b th:unless="${pageCount}=='0'">
                <li>
                    <a th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/'+${pageCount}+'/'+${category}">>></a>
                </li>
            </b>
            <b th:if="${pageCount}=='0'">
                <li>
                    <a th:href="'/directionary/admin/logdispprjGet/'+${isDetail}+'/'+${startTime}+'/'+${endTime}+'/'+${actionName}+'/'+${dateType}+'/1'+'/'+${category}">>></a>
                </li>
            </b>
        </b>
    </ul>
</div>


<!--<script th:src="@{/pdfjs/jquery-1.11.3.min.pdfjs}"></script>-->
<script type="text/javascript" th:src="@{/page/page.js}"></script>

<!--开源模版引擎： art-template@4.12.2 for browser | https://github.com/aui/art-template  -->
<script th:src="@{/js/plugins/artTemplate.js}"></script>
<!--另一个插件，消息提示插件  -->
<script th:src="@{/js/plugins/message.js}"></script>
<!-- 必要插件：固定列滚动需要用到，鼠标滚动兼容多浏览器 -->
<script th:src="@{/js/jquery.mousewheel.min.js}"></script>
<!-- 总引入  -->
<script th:src="@{/js/zipJs/jqTable.all.min.js}"></script>

<!-- 也可分开引入  -->
<!-- <script src="pdfjs/jqTable.all.pdfjs"></script> -->
<!-- <script src="pdfjs/jqTablePlugins.pdfjs"></script>
<script src="pdfjs/jqTable.pdfjs"></script> -->
<!-- 临时用的json -->
<script th:src="@{/js/json.js}"></script>
<script type="text/javascript">
    function del() {
        var t1 = $("#time1").val();
        var t2 = $("#time2").val();
        var ac = "全文访问日志";
        $.post("/directionary/admin/logdispprjDelete",{
            startTime: t1,
            endTime: t2,
            actionName: ac
        },function () {
            alert("清空成功")
            window.location.reload()
        })
    };
    function search(isDetail) {
        var t1 = $("#time1").val();
        var t2 = $("#time2").val();
        var ac = $("#action1").val();
        var ca=$("#category").val();
        if (isDetail ==0){
            var dt = $("#dateType").val();
            var url="/directionary/admin/logdispprjGet/0/"+t1+"/"+t2+"/全文访问日志/"+dt+"/1/"+ca;
            window.location.replace(url)
        } else{
            var url="/directionary/admin/logdispprjGet/1/"+t1+"/"+t2+"/全文访问日志/1/1/1";
            window.location.replace(url)
        }
    }
</script>
<script>
    laydate.render({
        elem: '#time1'
    });
    laydate.render({
        elem: '#time2'
    });
</script>
</body>
</html>
